﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenUDIDCSharp;

namespace Apmetrix
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.label5.Text = "0";
            this.label6.Text = "0";
            this.label7.Text = "0";
            this.label8.Text = "0";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Console.WriteLine("CALLING INIT");
            Apmetrix.init(100101, "C# Test 0.1", "90E874C97F0045A2904CF8BC85505543");
            this.label5.Text = OpenUDID.value;
            this.label6.Text = ApmetrixThread.getSessionID().ToString();
            this.label7.Text = ApmetrixThread.getPackets().ToString();
            this.label8.Text = ApmetrixThread.getSesCount().ToString();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Apmetrix.resetartSession();
            this.label5.Text = OpenUDID.value;
            this.label6.Text = ApmetrixThread.getSessionID().ToString();
            this.label7.Text = ApmetrixThread.getPackets().ToString();
            this.label8.Text = ApmetrixThread.getSesCount().ToString();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Apmetrix.CustomEvent table = CustomRPGEventData.getTable();
            string[] parameters = CustomRPGEventData.getParameters();
            int status = Apmetrix.logEvent(table, parameters);
            this.label5.Text = OpenUDID.value;
            this.label6.Text = ApmetrixThread.getSessionID().ToString();
            this.label7.Text = ApmetrixThread.getPackets().ToString();
            this.label8.Text = ApmetrixThread.getSesCount().ToString();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Apmetrix.endSession();
            this.label5.Text = OpenUDID.value;
            this.label6.Text = ApmetrixThread.getSessionID().ToString();
            this.label7.Text = ApmetrixThread.getPackets().ToString();
            this.label8.Text = ApmetrixThread.getSesCount().ToString();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }


    }
}
